Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@quenty/servicebag
Advanced tools
Service providing mechanisms for Nevermore
npm install @quenty/servicebag --save
:Init()
:Start()
GetService<IService>()
-- Main script
local serviceBag = require("ServiceBag").new()
serviceBag:AddService(require("TransparencyService"))
serviceBag:Init()
serviceBag:Start()
-- Other script
local TransparencyService = require("TransparencyService") -- force declaration at top
local TestClass = {}
TestClass.ClassName = "TestClass"
TestClass.__index = TestClass
function TestClass.new(serviceBag)
local self = setmetatable({}, TestClass)
self._serviceProvider = assert(serviceBag, "No serviceBag")
self._transparencyService = self._serviceProvider:GetRequiredService(TransparencyService)
return self
end
return TestClass
local DialogPane = setmetatable({}, BasicPane)
DialogPane.ClassName = "DialogPane"
DialogPane.__index = DialogPane
function DialogPane.new(serviceBag)
local self = setmetatable(BasicPane.new(serviceBag:GetService(DialogTemplatesClient):Clone("DialogPaneTemplate")), DialogPane)
self._theme = Instance.new("StringValue")
self._theme.Value = "Light"
self._maid:GiveTask(self._theme)
self._dialogInput = DialogInput.new()
self._maid:GiveTask(self._dialogInput)
Right now services and classes aren't the same. There's no contract to transform a class with lifetime into a service. However, because some of our services actually implement a .new() method (i.e. service definitions can be classes), we can't differentiate easily.
The issue is around life-cycle.
Other service providers solve this issue by doing the following...
We inherently don't want to separate out interfaces yet because we don't know what the actors or tie-interfaces for hot reloading will even look like.
It's important that we don't define this yet because there's a good chance separation at the service layer will be very important (i.e. we'll want to observe service state existing).
We could establish a contract that providing an interface will be allowed. That is, a service can return a value it'd like to use as an interface instead. We may need to wait until we resolve these other problems first.
FAQs
Service providing mechanisms for Nevermore
The npm package @quenty/servicebag receives a total of 44 weekly downloads. As such, @quenty/servicebag popularity was classified as not popular.
We found that @quenty/servicebag demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.